package com.blb.service.impl;

import com.blb.entity.Par;
import com.blb.mapper.ParMapper;
import com.blb.service.IParService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author HuaHao
 * @since 2019-11-15
 */
@Service
public class ParServiceImpl extends ServiceImpl<ParMapper, Par> implements IParService {

    @Resource
    private ParMapper parMapper;

    /**
     * 模糊查询，获取到我审核公司的详细信息并且开启分页查询
     * @param companyId 自己公司的ID
     * @param comName 模糊查询的公司名
     * @param startTime
     * @param endTime
     * @param start
     * @param length
     * @return
     */
    @Override
    public List<Par> selInfo(String companyId, String comName, String startTime, String endTime,int start ,int length) {
        return parMapper.selInfo(companyId,comName,startTime,endTime,start,length);
    }

    /**
     * 获取到我审核公司的个数
     * @param companyId
     * @param comName
     * @param startTime
     * @param endTime
     * @return
     */
    @Override
    public int getSelfCount(String companyId, String comName, String startTime, String endTime) {
        return parMapper.getSelfCount(companyId, comName, startTime, endTime);
    }

    /**
     * 模糊查询，获取到我申请公司的详细信息并且开启分页查询
     * @param companyId
     * @param startTime
     * @param endTime
     * @param start
     * @param length
     * @return
     */
    @Override
    public List<Par> selInfoByApply(String companyId, String startTime, String endTime, int start, int length) {
        return parMapper.selInfoByApply(companyId,startTime,endTime,start,length);
    }

    /**
     * 获取到我申请公司的个数
     * @param companyId
     * @param startTime
     * @param endTime
     * @return
     */
    @Override
    public int getOtherCount(String companyId, String startTime, String endTime) {
        return parMapper.getOtherCount(companyId, startTime, endTime);
    }

    /**
     * 获取本公司与其他公司的联系，然后返回一个类
     * @param comApply
     * @param comBeApply
     * @param relation
     * @return
     */
    @Override
    public Par selSelfApply(String comApply, String comBeApply,String relation) {
        return parMapper.selSelfApply(comApply, comBeApply, relation);
    }
}
